//
//  customReasonViewController.m
//  TT
//
//  Created by lanou3g on 16/3/15.
//  Copyright © 2016年 Super磊. All rights reserved.
//

#import "customReasonViewController.h"

@interface customReasonViewController ()<UITextFieldDelegate>

@property(nonatomic, strong)UILabel *label;
@property(nonatomic, strong)UILabel *number;
@property(nonatomic, strong)UITextView *textV;

@end

@implementation customReasonViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"举报";
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"cancel_31.929203539823px_1143862_easyicon.net.png"] style:(UIBarButtonItemStyleDone) target:self action:@selector(leftAction)];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"举报" style:(UIBarButtonItemStyleDone) target:self action:@selector(rightAction)];
    
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, 160, 30)];
    self.label.text = @"举报该用户的理由";
    self.label.textColor = [UIColor grayColor];
    [self.view addSubview:self.label];
    
    self.number = [[UILabel alloc] initWithFrame:CGRectMake(300, 0, kScreenWidth - 320, 30)];
    self.number.text = @"500";
    self.number.textColor = [UIColor grayColor];
    self.number.textAlignment = NSTextAlignmentRight;
    [self.view addSubview:self.number];
    
    self.textV = [[UITextView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.label.frame), kScreenWidth, 180)];
    self.textV.editable = YES;
    [self.view addSubview:self.textV];
//    self.textV.delegate = self;
    
    self.textV.backgroundColor = [UIColor cyanColor];
}

- (void)leftAction {
    [self dismissViewControllerAnimated:YES completion:nil];
}
- (void)rightAction {
    UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"谢谢" message:@"TT已经收到你的举报了" preferredStyle:(UIAlertControllerStyleAlert)];
    UIAlertAction *ok = [UIAlertAction actionWithTitle:@"好" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    [alertC addAction:ok];
    [self presentViewController:alertC animated:YES completion:nil];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.textV performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.1];
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.textV resignFirstResponder];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
